<template>
  <view class="center">
    <headBar title="个人中心"></headBar>
    <view class="xmain">
      <view class="xheader_wrap uni-flex uni-row">
        <view class="flex-item xheader_item">
          <uni-icons type="contact" size="60" color="#FFFFFF" ></uni-icons>
        </view>
        <view class="nick_item flex-item">
          <view class=" uni-flex uni-column">
            <view class="flex-item flex-item-V">
              ID:{{ userInfo.nickName }}
            </view>
            <view class="flex-item flex-item-V">
              <text @click="x_redirect('/pages/coins/coins')">金币：{{ userInfo.coins }}</text>
			        <text style="margin-left:30rpx;border:1px solid #FFFFFF;font-size:25rpx;padding:5rpx 10rpx;" @click="x_redirect('/pages/my/withdrawal')">提现</text>
            </view>
          </view>
        </view>
      </view>
      <view class="mytab">
        <view class="uni-panel-c" v-for="item in menuList">
          <view class="uni-navigate-item" @click="x_redirect(item.path)">
            <text class="uni-navigate-text">{{ item.title }}</text>
            <text class="uni-navigate-icon uni-icon">&#xe470;</text>
          </view>
        </view>
      </view>
    </view>
    <bootNav nav="my"></bootNav>
  </view>
</template>

<script>
import x from '@/common/base.js';

export default {
  data() {
    return {
      xheader_item_image: {
        width: 60,
        height: 60,
        border: {
          radius: "50%"
        },
        margin: {
          left: 20
        }
      },
      userInfo: {},
      default_head: [{
        url: '/static/user.png',
        extname: 'png',
        name: 'shuijiao.png'
      }],
      showNickNameEdit: false,
      menuList: []
    }
  },
  onReady: function () {
    this.getUserInfo()
    this.getMyMenu(this)
    // this.cpAd();
  },
  methods: {
    getUserInfo() {
      var t = this;
      var userInfo = x.getUserInfo(this);
      if(userInfo){
        t.userInfo = userInfo
      }
    },
    getMyMenu() {
      var t = this;
      t.menuList = [
        {title:"我的收藏",path:'/pages/collect/lst'},
        {title:"我的错题",path:'/pages/wrong/lst'},
        {title:"我的题库",path:'/pages/sign/sign'},
        {title:"投诉与建议",path:'/pages/complaint/complaint'},
      ];
    }
  }
}
</script>

<style lang="scss">
@import "./my.css";
</style>
